<template>
	<view class="page">
		<view class="flex0">
			<u-navbar :fixed='false' bgColor="transparent" :autoBack="true" :title="info.title">
				<view slot="center" class="navTitle">
					{{info.title||''}} 
				</view>
			</u-navbar>
		</view>
		<view class="flex1">
			<scroll-view scroll-y="true" class="scrollView pt30">
				<view class="pd30">
					<view class="siglePage">
						<view class="tit">
							{{info.title||''}}
						</view>
						<u-parse class="content" v-html="info.content"></u-parse>
					</view>
				</view>
			</scroll-view>
		</view>
		<view class="flex0 fft" v-if="checkModel">
			<view class="pd30">
				<view class="btn" @tap="check">
					确认
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				eventChannel:null,
				itemid:'',
				info:{},
				checkModel:false
			}
		},
		methods: {
			navBack(){
				uni.navigateBack()
			},
			check(){
				this.eventChannel.emit('checked');
				this.navBack();
			},
				getInfo(id) {
					this.$api.articleInfo({
						id
					}, res => {
						if (res.code == 200) {
							this.info = res.data
						}
					})
				},
				
		},
		mounted(){},
		onLoad:function(e){
				this.getInfo(e.id);
				
			// var that=this;
			// var pages = getCurrentPages();
			// var page = pages[pages.length - 1];
			// that.$data.eventChannel = this.getOpenerEventChannel();
			// that.$data.eventChannel.on('checkModel', function(data) {
			//     that.$data.checkModel=true;
			// });
			// if(page.options['id']){
			// 	this.$data.itemid = page.options['id'];
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.fft{
		padding: 40rpx 0;
		background: #fff;
		border-radius: 30rpx 30rpx 0 0;
		.btn{
			line-height: 90rpx;
			text-align: center;
			background: #fe9c29;
			color: #fff;
			font-size: 28rpx;
			border-radius: 90rpx;
		}
	}
	.siglePage{
		.tit{
			font-size: 48rpx;
			color: #65554d;
			font-weight: bold;
			margin-bottom: 40rpx;
			text-align: center;
		}
		.content{
			line-height: 1.6;
			color: #897f7a;
			font-size: 28rpx;
		}
	}
</style>
